package com.tedu.bill;

import java.util.Scanner;

/**
 * Author：毕龙
 * Date: 2024/3/20 19:51
 */
public class TestSwitchLogin {
    public static void main(String[] args) {
        System.out.println("*************************************");
        System.out.println("**********欢迎登录建设银行ATM**********");
        System.out.println("*************************************");
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入用户名：");
        String username = sc.next();
        System.out.println("请输入用户名：");
        String password = sc.next();
        if(username.equals("曹洋")){
            if(password.equals("123")){
                System.out.println("*************************************");
                System.out.println("**********欢迎:"+username+"**********");
                System.out.println("*************************************");
                System.out.println("1.修改密码  2.取款  3.存款  4.转账  5.退出");
                System.out.println("请输入您的选择：");
                int no = sc.nextInt();
                switch (no){
                    case 1:
                        System.out.println("请输入原密码：");
                        String pass = sc.next();
                        if(pass.equals("123")){
                            System.out.println("请输入新密码：");
                            String newPass1 = sc.next();
                            System.out.println("请再次输入新密码：");
                            String newPass2 = sc.next();
                            if(newPass1.equals(newPass2)){
                                System.out.println("修改密码成功！！");
                            }else{
                                System.out.println("两次输入的密码不一样！！");
                            }
                        }else{
                            System.out.println("原密码错误");
                            return;
                        }

                        break;
                    case 2:
                        System.out.println("存款成功！！");
                        break;
                    case 3:
                        System.out.println("取款成功！！");
                        break;
                    case 4:
                        System.out.println("转账成功！！");
                        break;
                    case 5:
                        System.exit(0);
                    default:
                        System.out.println("输错错误！！");
                }
            }else{
                System.out.println("密码错误");
            }
        }else{
            System.out.println("用户名错误");
        }
    }
}
